package com.github.io.config;

import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/9/1 17:26
 * Description: 配置 flowable初始化数据库功能
 */

@Configuration
public class FlowableConfiguration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
    @Override
    public void configure(SpringProcessEngineConfiguration engineConfiguration) {
        // 代码设置初始化flowable数据 ( 等价于yml文件配置: flowable.database-schema-update = true )
        engineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
        // 设置数据库类型
        engineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DATABASE_TYPE_MYSQL);
    }
}
